<?php

class Intl_Message_Db
{
	public function & load($lang, $default_lang = 'en')
	{
		$table = Model::getTable('core/phrase');

		$select = $table -> select() -> from($table -> getName(), array(
			'phrase',
			'translate_text'
		)) -> where('lang=?', $lang);
		
		$data = array();
		foreach ($table->fetchAll($select) as $row)
		{
			$data[$row -> phrase] = $row -> translate_text;
		}

		return $data;
	}

}
